<?php
/**
 * 公告控制层
 * 
 * @copyright 	Copyright (c) 2011 thinkapk.com All rights reserved.
 * @package 	ThinkAPK_Action
 * @link 		http://www.thinkapk.com/
 * @author 		richie <richbossman@163.com>
 * @version 	$Id: NoticeAction.class.php 7548 2011-05-31 09:54:33Z richie $
 * 
 */
class NoticeAction extends ThinkAPK_Action_Mall {
	
	//详情
	function _before_index(){
		$notice = D('Article')->getByArticle_id($_GET['id']);
		if(!$notice){
			$this->error('');
		}
		//跳转
		if(!empty($notice['link']) && $notice['link'] != 'http://'){
			header('Location:'.$notice['link']);
		}
		$this->setTitle($notice['title']);
		$this->setKeywords($notice['keywords']);
		$this->setDescription($notice['article_attr']);
		$position = '<a href="'.U('mall://Notice', array('page'=>1)).'">实惠公告</a><span>&gt;</span>';
		$this->setPosition(0, $position.$notice['title']);
		$this->assign('noticeinfo', $notice);
	}
	
	//列表
	function noticeList(){
		$this->setTitle('实惠公告');
		$this->setPosition(0, '实惠公告');
		$this->display();
	}
}
?>